# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=qtox
pkgver=1.17.6
pkgrel=4
pkgdesc="IM client using the encrypted peer-to-peer Tox protocol"
url="https://qtox.github.io/"
# armhf: sonnet
# ppc64le: fails tests
arch="all !armhf !ppc64le"
license="GPL-3.0-or-later"
makedepends="
	cmake
	samurai
	qt5-qtbase-dev
	qt5-qttools-dev
	qt5-qtsvg-dev
	ffmpeg-dev
	libexif-dev
	libqrencode-dev
	libsodium-dev
	sqlcipher-dev
	libvpx-dev
	sonnet5-dev
	toxcore-dev
	openal-soft-dev
	"
source="https://github.com/qTox/qTox/archive/refs/tags/v$pkgver/qtox-$pkgver.tar.gz"
builddir="$srcdir/qTox-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
92047769fa7c1b1be23a236072e6a8727fc956a8959c7a1f36a616d2217f558bd435cf28acdb73dc83e52cf46772c7aa4068c589bc095d327efac5495c4b3e39  qtox-1.17.6.tar.gz
"
